mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #1751 -- Remove XP_MACOSX conditionals from /dom
This commit is contained in:
parent
434b3269fb
commit
d29e4f8306
71 changed files with 100 additions and 5342 deletions
|
|
@ -24,7 +24,7 @@ static int gNotOptimized;
|
|||
using namespace mozilla::layers;
|
||||
|
||||
namespace mozilla {
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
nsresult
|
||||
PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
|
||||
NPPluginFuncs* pFuncs, NPError* error)
|
||||
|
|
@ -110,7 +110,7 @@ nsresult
|
|||
PluginPRLibrary::NP_GetValue(void *future, NPPVariable aVariable,
|
||||
void *aValue, NPError* error)
|
||||
{
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
if (mNP_GetValue) {
|
||||
*error = mNP_GetValue(future, aVariable, aValue);
|
||||
} else {
|
||||
|
|
@ -125,7 +125,7 @@ PluginPRLibrary::NP_GetValue(void *future, NPPVariable aVariable,
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
nsresult
|
||||
PluginPRLibrary::NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error)
|
||||
{
|
||||
|
|
@ -231,17 +231,7 @@ PluginPRLibrary::GetImageContainer(NPP instance, ImageContainer** aContainer)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
nsresult
|
||||
PluginPRLibrary::IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing)
|
||||
{
|
||||
nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
|
||||
NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
|
||||
*aDrawing = false;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
nsresult
|
||||
PluginPRLibrary::ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@ class PluginPRLibrary : public PluginLibrary
|
|||
{
|
||||
public:
|
||||
PluginPRLibrary(const char* aFilePath, PRLibrary* aLibrary) :
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
mNP_Initialize(nullptr),
|
||||
#else
|
||||
mNP_Initialize(nullptr),
|
||||
#endif
|
||||
mNP_Shutdown(nullptr),
|
||||
mNP_GetMIMEDescription(nullptr),
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
mNP_GetValue(nullptr),
|
||||
#endif
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
mNP_GetEntryPoints(nullptr),
|
||||
#endif
|
||||
mNPP_New(nullptr),
|
||||
|
|
@ -60,19 +60,17 @@ public:
|
|||
|
||||
mNP_GetMIMEDescription = (NP_GetMIMEDescriptionFunc)
|
||||
PR_FindFunctionSymbol(mLibrary, "NP_GetMIMEDescription");
|
||||
#ifndef XP_MACOSX
|
||||
if (!mNP_GetMIMEDescription)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
mNP_GetValue = (NP_GetValueFunc)
|
||||
PR_FindFunctionSymbol(mLibrary, "NP_GetValue");
|
||||
if (!mNP_GetValue)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
mNP_GetEntryPoints = (NP_GetEntryPointsFunc)
|
||||
PR_FindFunctionSymbol(mLibrary, "NP_GetEntryPoints");
|
||||
if (!mNP_GetEntryPoints)
|
||||
|
|
@ -81,7 +79,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
virtual nsresult NP_Initialize(NPNetscapeFuncs* aNetscapeFuncs,
|
||||
NPPluginFuncs* aFuncs, NPError* aError) override;
|
||||
#else
|
||||
|
|
@ -95,7 +93,7 @@ public:
|
|||
virtual nsresult NP_GetValue(void* aFuture, NPPVariable aVariable,
|
||||
void* aValue, NPError* aError) override;
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
virtual nsresult NP_GetEntryPoints(NPPluginFuncs* aFuncs, NPError* aError) override;
|
||||
#endif
|
||||
|
||||
|
|
@ -112,10 +110,7 @@ public:
|
|||
virtual nsresult GetImageContainer(NPP aInstance, mozilla::layers::ImageContainer** aContainer) override;
|
||||
virtual nsresult GetImageSize(NPP aInstance, nsIntSize* aSize) override;
|
||||
virtual bool IsOOP() override { return false; }
|
||||
#if defined(XP_MACOSX)
|
||||
virtual nsresult IsRemoteDrawingCoreAnimation(NPP aInstance, bool* aDrawing) override;
|
||||
#endif
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
virtual nsresult ContentsScaleFactorChanged(NPP aInstance, double aContentsScaleFactor) override;
|
||||
#endif
|
||||
virtual nsresult SetBackgroundUnknown(NPP instance) override;
|
||||
|
|
@ -139,10 +134,10 @@ private:
|
|||
NP_InitializeFunc mNP_Initialize;
|
||||
NP_ShutdownFunc mNP_Shutdown;
|
||||
NP_GetMIMEDescriptionFunc mNP_GetMIMEDescription;
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
NP_GetValueFunc mNP_GetValue;
|
||||
#endif
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
NP_GetEntryPointsFunc mNP_GetEntryPoints;
|
||||
#endif
|
||||
NPP_NewProcPtr mNPP_New;
|
||||
|
|
|
|||
|
|
@ -22,25 +22,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE_CC__) && !defined(XP_UNIX)
|
||||
#ifndef XP_MACOSX
|
||||
#define XP_MACOSX 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX) && defined(__LP64__)
|
||||
#define NP_NO_QUICKDRAW
|
||||
#define NP_NO_CARBON
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#ifndef NP_NO_CARBON
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(XP_UNIX)
|
||||
#include <stdio.h>
|
||||
#if defined(MOZ_X11)
|
||||
|
|
@ -117,12 +98,6 @@ typedef char* NPMIMEType;
|
|||
/* Structures and definitions */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#if !defined(__LP64__)
|
||||
#if defined(XP_MACOSX)
|
||||
#pragma options align=mac68k
|
||||
#endif
|
||||
#endif /* __LP64__ */
|
||||
|
||||
/*
|
||||
* NPP is a plug-in's opaque instance handle
|
||||
*/
|
||||
|
|
@ -280,15 +255,6 @@ typedef struct _NPAudioDeviceChangeDetails
|
|||
|
||||
typedef enum {
|
||||
NPDrawingModelDUMMY
|
||||
#if defined(XP_MACOSX)
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
, NPDrawingModelQuickDraw = 0
|
||||
#endif
|
||||
, NPDrawingModelCoreGraphics = 1
|
||||
, NPDrawingModelOpenGL = 2
|
||||
, NPDrawingModelCoreAnimation = 3
|
||||
, NPDrawingModelInvalidatingCoreAnimation = 4
|
||||
#endif
|
||||
#if defined(XP_WIN)
|
||||
, NPDrawingModelSyncWin = 5
|
||||
#endif
|
||||
|
|
@ -301,15 +267,6 @@ typedef enum {
|
|||
#endif
|
||||
} NPDrawingModel;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
typedef enum {
|
||||
#ifndef NP_NO_CARBON
|
||||
NPEventModelCarbon = 0,
|
||||
#endif
|
||||
NPEventModelCocoa = 1
|
||||
} NPEventModel;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following masks are applied on certain platforms to NPNV and
|
||||
* NPPV selectors that pass around pointers to COM interfaces. Newer
|
||||
|
|
@ -337,12 +294,7 @@ typedef enum {
|
|||
#define _NP_ABI_MIXIN_FOR_GCC3 0
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#define NP_ABI_MACHO_MASK 0x01000000
|
||||
#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
|
||||
#else
|
||||
#define _NP_ABI_MIXIN_FOR_MACHO 0
|
||||
#endif
|
||||
|
||||
#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
|
||||
|
||||
|
|
@ -393,12 +345,6 @@ typedef enum {
|
|||
|
||||
/* Used for negotiating drawing models */
|
||||
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
|
||||
/* Notification that the plugin just started or stopped playing audio */
|
||||
, NPPVpluginIsPlayingAudio = 4000
|
||||
#if defined(XP_WIN)
|
||||
|
|
@ -442,39 +388,18 @@ typedef enum {
|
|||
NPNVCSSZoomFactor = 23,
|
||||
|
||||
NPNVpluginDrawingModel = 1000 /* Get the current drawing model (NPDrawingModel) */
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
, NPNVcontentsScaleFactor = 1001
|
||||
#endif
|
||||
#if defined(XP_MACOSX)
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
, NPNVsupportsQuickDrawBool = 2000
|
||||
#endif
|
||||
, NPNVsupportsCoreGraphicsBool = 2001
|
||||
, NPNVsupportsOpenGLBool = 2002
|
||||
, NPNVsupportsCoreAnimationBool = 2003
|
||||
, NPNVsupportsInvalidatingCoreAnimationBool = 2004
|
||||
#endif
|
||||
, NPNVsupportsAsyncBitmapSurfaceBool = 2007
|
||||
#if defined(XP_WIN)
|
||||
, NPNVsupportsAsyncWindowsDXGISurfaceBool = 2008
|
||||
, NPNVpreferredDXGIAdapter = 2009
|
||||
#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. */
|
||||
#endif
|
||||
, NPNVmuteAudioBool = 4000 /* Request that the browser wants to mute or unmute the plugin */
|
||||
#if defined(XP_WIN)
|
||||
, NPNVaudioDeviceChangeDetails = 4001 /* Provides information about the new default audio device */
|
||||
#endif
|
||||
#if defined(XP_MACOSX)
|
||||
, NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
|
||||
CA model compositing */
|
||||
#endif
|
||||
} NPNVariable;
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -509,7 +434,7 @@ typedef struct _NPWindow
|
|||
uint32_t width; /* Maximum window size */
|
||||
uint32_t height;
|
||||
NPRect clipRect; /* Clipping rectangle in port coordinates */
|
||||
#if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX) || defined(XP_SYMBIAN)
|
||||
void * ws_info; /* Platform-dependent additional data */
|
||||
#endif /* XP_UNIX */
|
||||
NPWindowType type; /* Is this a window or a drawable? */
|
||||
|
|
@ -555,11 +480,7 @@ typedef struct _NPPrint
|
|||
} print;
|
||||
} NPPrint;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#ifndef NP_NO_CARBON
|
||||
typedef EventRecord NPEvent;
|
||||
#endif
|
||||
#elif defined(XP_SYMBIAN)
|
||||
#if defined(XP_SYMBIAN)
|
||||
typedef QEvent NPEvent;
|
||||
#elif defined(XP_WIN)
|
||||
typedef struct _NPEvent
|
||||
|
|
@ -574,13 +495,7 @@ typedef XEvent NPEvent;
|
|||
typedef void* NPEvent;
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
typedef void* NPRegion;
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
typedef RgnHandle NPQDRegion;
|
||||
#endif
|
||||
typedef CGPathRef NPCGRegion;
|
||||
#elif defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
typedef HRGN NPRegion;
|
||||
#elif defined(XP_UNIX) && defined(MOZ_X11)
|
||||
typedef Region NPRegion;
|
||||
|
|
@ -594,11 +509,7 @@ typedef struct _NPNSString NPNSString;
|
|||
typedef struct _NPNSWindow NPNSWindow;
|
||||
typedef struct _NPNSMenu NPNSMenu;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
typedef NPNSMenu NPMenu;
|
||||
#else
|
||||
typedef void *NPMenu;
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
NPCoordinateSpacePlugin = 1,
|
||||
|
|
@ -608,112 +519,6 @@ typedef enum {
|
|||
NPCoordinateSpaceFlippedScreen
|
||||
} NPCoordinateSpace;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
typedef struct NP_Port
|
||||
{
|
||||
CGrafPtr port;
|
||||
int32_t portx; /* position inside the topmost window */
|
||||
int32_t porty;
|
||||
} NP_Port;
|
||||
#endif /* NP_NO_QUICKDRAW */
|
||||
|
||||
/*
|
||||
* NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
|
||||
* as its drawing model.
|
||||
*/
|
||||
|
||||
typedef struct NP_CGContext
|
||||
{
|
||||
CGContextRef context;
|
||||
void *window; /* A WindowRef under the Carbon event model. */
|
||||
} NP_CGContext;
|
||||
|
||||
/*
|
||||
* NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
|
||||
* drawing model.
|
||||
*/
|
||||
|
||||
typedef struct NP_GLContext
|
||||
{
|
||||
CGLContextObj context;
|
||||
#ifdef NP_NO_CARBON
|
||||
NPNSWindow *window;
|
||||
#else
|
||||
void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
|
||||
#endif
|
||||
} NP_GLContext;
|
||||
|
||||
typedef enum {
|
||||
NPCocoaEventDrawRect = 1,
|
||||
NPCocoaEventMouseDown,
|
||||
NPCocoaEventMouseUp,
|
||||
NPCocoaEventMouseMoved,
|
||||
NPCocoaEventMouseEntered,
|
||||
NPCocoaEventMouseExited,
|
||||
NPCocoaEventMouseDragged,
|
||||
NPCocoaEventKeyDown,
|
||||
NPCocoaEventKeyUp,
|
||||
NPCocoaEventFlagsChanged,
|
||||
NPCocoaEventFocusChanged,
|
||||
NPCocoaEventWindowFocusChanged,
|
||||
NPCocoaEventScrollWheel,
|
||||
NPCocoaEventTextInput
|
||||
} NPCocoaEventType;
|
||||
|
||||
typedef struct _NPCocoaEvent {
|
||||
NPCocoaEventType type;
|
||||
uint32_t version;
|
||||
union {
|
||||
struct {
|
||||
uint32_t modifierFlags;
|
||||
double pluginX;
|
||||
double pluginY;
|
||||
int32_t buttonNumber;
|
||||
int32_t clickCount;
|
||||
double deltaX;
|
||||
double deltaY;
|
||||
double deltaZ;
|
||||
} mouse;
|
||||
struct {
|
||||
uint32_t modifierFlags;
|
||||
NPNSString *characters;
|
||||
NPNSString *charactersIgnoringModifiers;
|
||||
NPBool isARepeat;
|
||||
uint16_t keyCode;
|
||||
} key;
|
||||
struct {
|
||||
CGContextRef context;
|
||||
double x;
|
||||
double y;
|
||||
double width;
|
||||
double height;
|
||||
} draw;
|
||||
struct {
|
||||
NPBool hasFocus;
|
||||
} focus;
|
||||
struct {
|
||||
NPNSString *text;
|
||||
} text;
|
||||
} data;
|
||||
} NPCocoaEvent;
|
||||
|
||||
#ifndef NP_NO_CARBON
|
||||
/* Non-standard event types that can be passed to HandleEvent */
|
||||
enum NPEventType {
|
||||
NPEventType_GetFocusEvent = (osEvt + 16),
|
||||
NPEventType_LoseFocusEvent,
|
||||
NPEventType_AdjustCursorEvent,
|
||||
NPEventType_MenuCommandEvent,
|
||||
NPEventType_ClippingChangedEvent,
|
||||
NPEventType_ScrollingBeginsEvent = 1000,
|
||||
NPEventType_ScrollingEndsEvent
|
||||
};
|
||||
#endif /* NP_NO_CARBON */
|
||||
|
||||
#endif /* XP_MACOSX */
|
||||
|
||||
/*
|
||||
* Values for mode passed to NPP_New:
|
||||
*/
|
||||
|
|
@ -736,12 +541,6 @@ enum NPEventType {
|
|||
#define NP_CLEAR_ALL 0
|
||||
#define NP_CLEAR_CACHE (1 << 0)
|
||||
|
||||
#if !defined(__LP64__)
|
||||
#if defined(XP_MACOSX)
|
||||
#pragma options align=reset
|
||||
#endif
|
||||
#endif /* __LP64__ */
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Error and Reason Code definitions */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -182,31 +182,6 @@ typedef struct _NPNetscapeFuncs {
|
|||
NPN_SetCurrentAsyncSurfacePtr setcurrentasyncsurface;
|
||||
} NPNetscapeFuncs;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
/*
|
||||
* Mac OS X version(s) of NP_GetMIMEDescription(const char *)
|
||||
* These can be called to retreive MIME information from the plugin dynamically
|
||||
*
|
||||
* Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
|
||||
* to get mime info from the plugin only on OSX and may not be supported
|
||||
* in furture version -- use NP_GetMIMEDescription instead
|
||||
*/
|
||||
enum
|
||||
{
|
||||
kBPSupportedMIMETypesStructVers_1 = 1
|
||||
};
|
||||
typedef struct _BPSupportedMIMETypes
|
||||
{
|
||||
SInt32 structVersion; /* struct version */
|
||||
Handle typeStrings; /* STR# formated handle, allocated by plug-in */
|
||||
Handle infoStrings; /* STR# formated handle, allocated by plug-in */
|
||||
} BPSupportedMIMETypes;
|
||||
OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
|
||||
#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
|
||||
typedef const char* (*NP_GetMIMEDescriptionProcPtr)(void);
|
||||
typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, UInt32);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define OSCALL WINAPI
|
||||
#else
|
||||
|
|
@ -251,15 +226,8 @@ typedef char* (*NP_GetPluginVersionFunc)(void);
|
|||
NP_EXPORT(char*) NP_GetPluginVersion(void);
|
||||
typedef const char* (*NP_GetMIMEDescriptionFunc)(void);
|
||||
NP_EXPORT(const char*) NP_GetMIMEDescription(void);
|
||||
#ifdef XP_MACOSX
|
||||
typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*);
|
||||
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
|
||||
typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
|
||||
NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
|
||||
#else
|
||||
typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
|
||||
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
|
||||
#endif
|
||||
typedef NPError (*NP_ShutdownFunc)(void);
|
||||
NP_EXPORT(NPError) NP_Shutdown(void);
|
||||
typedef NPError (*NP_GetValueFunc)(void *, NPPVariable, void *);
|
||||
|
|
|
|||
|
|
@ -269,14 +269,6 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (!pluginLib->HasRequiredFunctions()) {
|
||||
NS_WARNING("Not all necessary functions exposed by plugin, it will not load.");
|
||||
delete pluginLib;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
plugin->mLibrary = pluginLib;
|
||||
pluginLib->SetPlugin(plugin);
|
||||
|
||||
|
|
@ -294,19 +286,6 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult)
|
|||
if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#elif defined(XP_MACOSX)
|
||||
// NP_Initialize must be called before NP_GetEntryPoints on Mac OS X.
|
||||
// We need to match WebKit's behavior.
|
||||
NPError pluginCallError;
|
||||
nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &pluginCallError);
|
||||
if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
rv = pluginLib->NP_GetEntryPoints(&plugin->mPluginFuncs, &pluginCallError);
|
||||
if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#else
|
||||
NPError pluginCallError;
|
||||
nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &plugin->mPluginFuncs, &pluginCallError);
|
||||
|
|
@ -1729,7 +1708,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||
// cases for android_npapi.h's non-standard ANPInterface values.
|
||||
switch (static_cast<int>(variable)) {
|
||||
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
case NPNVxDisplay : {
|
||||
#if defined(MOZ_X11)
|
||||
if (npp) {
|
||||
|
|
@ -1854,8 +1833,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||
}
|
||||
|
||||
case NPNVSupportsWindowless: {
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX) || \
|
||||
(defined(MOZ_X11) && defined(MOZ_WIDGET_GTK))
|
||||
#if defined(XP_WIN) || (defined(MOZ_X11) && defined(MOZ_WIDGET_GTK))
|
||||
*(NPBool*)result = true;
|
||||
#else
|
||||
*(NPBool*)result = false;
|
||||
|
|
@ -1923,72 +1901,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||
return *(char**)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
case NPNVpluginDrawingModel: {
|
||||
if (npp) {
|
||||
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance*)npp->ndata;
|
||||
if (inst) {
|
||||
NPDrawingModel drawingModel;
|
||||
inst->GetDrawingModel((int32_t*)&drawingModel);
|
||||
*(NPDrawingModel*)result = drawingModel;
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
}
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
case NPNVsupportsQuickDrawBool: {
|
||||
*(NPBool*)result = false;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
case NPNVsupportsCoreGraphicsBool: {
|
||||
*(NPBool*)result = true;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
case NPNVsupportsCoreAnimationBool: {
|
||||
*(NPBool*)result = true;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
case NPNVsupportsInvalidatingCoreAnimationBool: {
|
||||
*(NPBool*)result = true;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
case NPNVsupportsCompositingCoreAnimationPluginsBool: {
|
||||
*(NPBool*)result = PR_TRUE;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
#ifndef NP_NO_CARBON
|
||||
case NPNVsupportsCarbonBool: {
|
||||
*(NPBool*)result = false;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
#endif
|
||||
case NPNVsupportsCocoaBool: {
|
||||
*(NPBool*)result = true;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
case NPNVsupportsUpdatedCocoaTextInputBool: {
|
||||
*(NPBool*)result = true;
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
case NPNVcontentsScaleFactor: {
|
||||
nsNPAPIPluginInstance *inst =
|
||||
(nsNPAPIPluginInstance *) (npp ? npp->ndata : nullptr);
|
||||
|
|
@ -2051,16 +1964,8 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
|
|||
// actual pointer value is checked rather than its content
|
||||
// when passing booleans
|
||||
case NPPVpluginWindowBool: {
|
||||
#ifdef XP_MACOSX
|
||||
// This setting doesn't apply to OS X (only to Windows and Unix/Linux).
|
||||
// See https://developer.mozilla.org/En/NPN_SetValue#section_5. Return
|
||||
// NPERR_NO_ERROR here to conform to other browsers' behavior on OS X
|
||||
// (e.g. Safari and Opera).
|
||||
return NPERR_NO_ERROR;
|
||||
#else
|
||||
NPBool bWindowless = (result == nullptr);
|
||||
return inst->SetWindowless(bWindowless);
|
||||
#endif
|
||||
}
|
||||
case NPPVpluginTransparentBool: {
|
||||
NPBool bTransparent = (result != nullptr);
|
||||
|
|
@ -2145,18 +2050,6 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
case NPPVpluginEventModel: {
|
||||
if (inst) {
|
||||
inst->SetEventModel((NPEventModel)NS_PTR_TO_INT32(result));
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
else {
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
default:
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,10 +45,6 @@ public:
|
|||
// PluginFuncs() can't fail but results are only valid if GetLibrary() succeeds
|
||||
NPPluginFuncs* PluginFuncs();
|
||||
|
||||
#if defined(XP_MACOSX) && !defined(__LP64__)
|
||||
void SetPluginRefNum(short aRefNum);
|
||||
#endif
|
||||
|
||||
// The IPC mechanism notifies the nsNPAPIPlugin if the plugin
|
||||
// crashes and is no longer usable. pluginDumpID/browserDumpID are
|
||||
// the IDs of respective minidumps that were written, or empty if no
|
||||
|
|
|
|||
|
|
@ -60,9 +60,6 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
|
|||
, mPlugin(nullptr)
|
||||
, mMIMEType(nullptr)
|
||||
, mOwner(nullptr)
|
||||
#ifdef XP_MACOSX
|
||||
, mCurrentPluginEvent(nullptr)
|
||||
#endif
|
||||
, mHaveJavaC2PJSObjectQuirk(false)
|
||||
, mCachedParamLength(0)
|
||||
, mCachedParamNames(nullptr)
|
||||
|
|
@ -503,9 +500,6 @@ nsresult nsNPAPIPluginInstance::HandleEvent(void* event, int16_t* result,
|
|||
int16_t tmpResult = kNPEventNotHandled;
|
||||
|
||||
if (pluginFunctions->event) {
|
||||
#ifdef XP_MACOSX
|
||||
mCurrentPluginEvent = event;
|
||||
#endif
|
||||
#if defined(XP_WIN)
|
||||
NS_TRY_SAFE_CALL_RETURN(tmpResult, (*pluginFunctions->event)(&mNPP, event), this,
|
||||
aSafeToReenterGecko);
|
||||
|
|
@ -519,9 +513,6 @@ nsresult nsNPAPIPluginInstance::HandleEvent(void* event, int16_t* result,
|
|||
|
||||
if (result)
|
||||
*result = tmpResult;
|
||||
#ifdef XP_MACOSX
|
||||
mCurrentPluginEvent = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
@ -617,19 +608,6 @@ void nsNPAPIPluginInstance::RedrawPlugin()
|
|||
mOwner->RedrawPlugin();
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
void nsNPAPIPluginInstance::SetEventModel(NPEventModel aModel)
|
||||
{
|
||||
// the event model needs to be set for the object frame immediately
|
||||
if (!mOwner) {
|
||||
NS_WARNING("Trying to set event model without a plugin instance owner!");
|
||||
return;
|
||||
}
|
||||
|
||||
mOwner->SetEventModel(aModel);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult nsNPAPIPluginInstance::GetDrawingModel(int32_t* aModel)
|
||||
{
|
||||
*aModel = (int32_t)mDrawingModel;
|
||||
|
|
@ -638,24 +616,14 @@ nsresult nsNPAPIPluginInstance::GetDrawingModel(int32_t* aModel)
|
|||
|
||||
nsresult nsNPAPIPluginInstance::IsRemoteDrawingCoreAnimation(bool* aDrawing)
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
if (!mPlugin)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PluginLibrary* library = mPlugin->GetLibrary();
|
||||
if (!library)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return library->IsRemoteDrawingCoreAnimation(&mNPP, aDrawing);
|
||||
#else
|
||||
/** Mac Stub **/
|
||||
return NS_ERROR_FAILURE;
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsNPAPIPluginInstance::ContentsScaleFactorChanged(double aContentsScaleFactor)
|
||||
{
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
if (!mPlugin)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
|
@ -732,12 +700,7 @@ nsNPAPIPluginInstance::ShouldCache()
|
|||
nsresult
|
||||
nsNPAPIPluginInstance::IsWindowless(bool* isWindowless)
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
// All OS X plugins are windowless.
|
||||
*isWindowless = true;
|
||||
#else
|
||||
*isWindowless = mWindowless;
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,12 +34,6 @@ class nsPluginInstanceOwner;
|
|||
const NPDrawingModel kDefaultDrawingModel = NPDrawingModelSyncWin;
|
||||
#elif defined(MOZ_X11)
|
||||
const NPDrawingModel kDefaultDrawingModel = NPDrawingModelSyncX;
|
||||
#elif defined(XP_MACOSX)
|
||||
#ifndef NP_NO_QUICKDRAW
|
||||
const NPDrawingModel kDefaultDrawingModel = NPDrawingModelQuickDraw; // Not supported
|
||||
#else
|
||||
const NPDrawingModel kDefaultDrawingModel = NPDrawingModelCoreGraphics;
|
||||
#endif
|
||||
#else
|
||||
const NPDrawingModel kDefaultDrawingModel = static_cast<NPDrawingModel>(0);
|
||||
#endif
|
||||
|
|
@ -146,13 +140,6 @@ public:
|
|||
|
||||
void SetDrawingModel(NPDrawingModel aModel);
|
||||
void RedrawPlugin();
|
||||
#ifdef XP_MACOSX
|
||||
void SetEventModel(NPEventModel aModel);
|
||||
|
||||
void* GetCurrentEvent() {
|
||||
return mCurrentPluginEvent;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult NewStreamListener(const char* aURL, void* notifyData,
|
||||
nsNPAPIPluginStreamListener** listener);
|
||||
|
|
@ -291,11 +278,6 @@ private:
|
|||
|
||||
nsTArray<nsNPAPITimer*> mTimers;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// non-null during a HandleEvent call
|
||||
void* mCurrentPluginEvent;
|
||||
#endif
|
||||
|
||||
// Timestamp for the last time this plugin was stopped.
|
||||
// This is only valid when the plugin is actually stopped!
|
||||
mozilla::TimeStamp mStopTime;
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@
|
|||
#include "nsProtocolProxyService.h"
|
||||
#include "nsIStreamConverterService.h"
|
||||
#include "nsIFile.h"
|
||||
#if defined(XP_MACOSX)
|
||||
#include "nsILocalFileMac.h"
|
||||
#endif
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFileStreams.h"
|
||||
|
|
@ -1925,19 +1922,7 @@ int64_t GetPluginLastModifiedTime(const nsCOMPtr<nsIFile>& localfile)
|
|||
{
|
||||
PRTime fileModTime = 0;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
// On OS X the date of a bundle's "contents" (i.e. of its Info.plist file)
|
||||
// is a much better guide to when it was last modified than the date of
|
||||
// its package directory. See bug 313700.
|
||||
nsCOMPtr<nsILocalFileMac> localFileMac = do_QueryInterface(localfile);
|
||||
if (localFileMac) {
|
||||
localFileMac->GetBundleContentsLastModifiedTime(&fileModTime);
|
||||
} else {
|
||||
localfile->GetLastModifiedTime(&fileModTime);
|
||||
}
|
||||
#else
|
||||
localfile->GetLastModifiedTime(&fileModTime);
|
||||
#endif
|
||||
|
||||
return fileModTime;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -19,11 +19,6 @@
|
|||
#include "nsWeakReference.h"
|
||||
#include "gfxRect.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#include "mozilla/gfx/QuartzSupport.h"
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
|
||||
class nsIInputStream;
|
||||
class nsPluginDOMContextMenuListener;
|
||||
class nsPluginFrame;
|
||||
|
|
@ -104,10 +99,6 @@ public:
|
|||
|
||||
#ifdef XP_WIN
|
||||
void Paint(const RECT& aDirty, HDC aDC);
|
||||
#elif defined(XP_MACOSX)
|
||||
void Paint(const gfxRect& aDirtyRect, CGContextRef cgContext);
|
||||
void RenderCoreAnimation(CGContextRef aCGContext, int aWidth, int aHeight);
|
||||
void DoCocoaEventDrawRect(const gfxRect& aDrawRect, CGContextRef cgContext);
|
||||
#elif defined(MOZ_X11)
|
||||
void Paint(gfxContext* aContext,
|
||||
const gfxRect& aFrameRect,
|
||||
|
|
@ -132,33 +123,11 @@ public:
|
|||
nsresult SetNetscapeWindowAsParent(HWND aWindowToAdopt);
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
enum { ePluginPaintEnable, ePluginPaintDisable };
|
||||
|
||||
void WindowFocusMayHaveChanged();
|
||||
|
||||
bool WindowIsActive();
|
||||
void SendWindowFocusChanged(bool aIsActive);
|
||||
NPDrawingModel GetDrawingModel();
|
||||
bool IsRemoteDrawingCoreAnimation();
|
||||
|
||||
NPEventModel GetEventModel();
|
||||
static void CARefresh(nsITimer *aTimer, void *aClosure);
|
||||
void AddToCARefreshTimer();
|
||||
void RemoveFromCARefreshTimer();
|
||||
// This calls into the plugin (NPP_SetWindow) and can run script.
|
||||
void FixUpPluginWindow(int32_t inPaintState);
|
||||
void HidePluginWindow();
|
||||
// Set plugin port info in the plugin (in the 'window' member of the
|
||||
// NPWindow structure passed to the plugin by SetWindow()).
|
||||
void SetPluginPort();
|
||||
#else // XP_MACOSX
|
||||
void UpdateWindowPositionAndClipRect(bool aSetWindow);
|
||||
void UpdateWindowVisibility(bool aVisible);
|
||||
#endif // XP_MACOSX
|
||||
|
||||
void ResolutionMayHaveChanged();
|
||||
#if defined(XP_MACOSX) || defined(XP_WIN)
|
||||
#if defined(XP_WIN)
|
||||
nsresult ContentsScaleFactorChanged(double aContentsScaleFactor);
|
||||
#endif
|
||||
|
||||
|
|
@ -214,7 +183,7 @@ public:
|
|||
return mPluginWindow->type == NPWindowTypeDrawable &&
|
||||
(MatchPluginName("Shockwave Flash") ||
|
||||
MatchPluginName("Test Plug-in"));
|
||||
#elif defined(MOZ_X11) || defined(XP_MACOSX)
|
||||
#elif defined(MOZ_X11)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
|
@ -311,15 +280,6 @@ private:
|
|||
nsCOMPtr<nsIWidget> mWidget;
|
||||
RefPtr<nsPluginHost> mPluginHost;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
static nsCOMPtr<nsITimer> *sCATimer;
|
||||
static nsTArray<nsPluginInstanceOwner*> *sCARefreshListeners;
|
||||
bool mSentInitialTopLevelWindowEvent;
|
||||
bool mLastWindowIsActive;
|
||||
bool mLastContentFocused;
|
||||
// True if, the next time the window is activated, we should blur ourselves.
|
||||
bool mShouldBlurOnActivate;
|
||||
#endif
|
||||
double mLastScaleFactor;
|
||||
double mLastCSSZoomFactor;
|
||||
// Initially, the event loop nesting level we were created on, it's updated
|
||||
|
|
@ -335,15 +295,6 @@ private:
|
|||
bool mPluginWindowVisible;
|
||||
bool mPluginDocumentActiveState;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
NPEventModel mEventModel;
|
||||
// This is a hack! UseAsyncRendering() can incorrectly return false
|
||||
// when we don't have an object frame (possible as of bug 90268).
|
||||
// We hack around this by always returning true if we've ever
|
||||
// returned true.
|
||||
bool mUseAsyncRendering;
|
||||
#endif
|
||||
|
||||
// pointer to wrapper for nsIDOMContextMenuListener
|
||||
RefPtr<nsPluginDOMContextMenuListener> mCXMenuListener;
|
||||
|
||||
|
|
@ -357,16 +308,6 @@ private:
|
|||
void CallDefaultProc(const mozilla::WidgetGUIEvent* aEvent);
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
static NPBool ConvertPointPuppet(PuppetWidget *widget, nsPluginFrame* pluginFrame,
|
||||
double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
|
||||
double *destX, double *destY, NPCoordinateSpace destSpace);
|
||||
static NPBool ConvertPointNoPuppet(nsIWidget *widget, nsPluginFrame* pluginFrame,
|
||||
double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
|
||||
double *destX, double *destY, NPCoordinateSpace destSpace);
|
||||
void PerformDelayedBlurs();
|
||||
#endif // XP_MACOSX
|
||||
|
||||
int mLastMouseDownButtonType;
|
||||
|
||||
#ifdef MOZ_X11
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ nsPluginNativeWindowPLATFORM::nsPluginNativeWindowPLATFORM() : nsPluginNativeWin
|
|||
width = 0;
|
||||
height = 0;
|
||||
memset(&clipRect, 0, sizeof(clipRect));
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
ws_info = nullptr;
|
||||
#endif
|
||||
type = NPWindowTypeWindow;
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ void nsPluginTag::InitMime(const char* const* aMimeTypes,
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(XP_WIN) && !defined(XP_MACOSX)
|
||||
#if !defined(XP_WIN)
|
||||
static nsresult ConvertToUTF8(nsIUnicodeDecoder *aUnicodeDecoder,
|
||||
nsAFlatCString& aString)
|
||||
{
|
||||
|
|
@ -448,7 +448,7 @@ static nsresult ConvertToUTF8(nsIUnicodeDecoder *aUnicodeDecoder,
|
|||
|
||||
nsresult nsPluginTag::EnsureMembersAreUTF8()
|
||||
{
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN)
|
||||
return NS_OK;
|
||||
#else
|
||||
nsresult rv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue